#include <stdlib.h>
#include <stdio.h>

#include "list.h"

int main(int argc, char **argv) {
	List list = newList();
	insert(list, 3.0f);
	insert(list, 4.0f);
	insert(list, 5.0f);
	insert(list, 6.0f);
	printList(list);

	ElementType target = 3.0f;
	PtrToNode currNode = find(list, target);
	if (currNode == NULL) {
		printf("not found,target=%0.1f\n", target );
	} else {
		printf("found,target=%0.1f, result=%0.1f\n", target, retrive(currNode));
	}

	PtrToNode preNode = findPrevious(list, target);
	if (preNode == NULL) {
		printf("previous not found,target=%0.1f\n", target );
	} else {
		printf("previous found,target=%0.1f, result=%0.1f\n", target, retrive(preNode));
	}

	makeEmpty(list);
	printList(list);

	deleteList(list);
	return 0;
}